#include "fig_miniboss_bomber.h"
#include "fig_enemybullet_master.h"
#include "fighter.h"

#include "num/rand.h"
#include "math/facing.h"



FIGMiniBossBomber::FIGMiniBossBomber(FIGEnemyCraft::ENEMY_TYPES EnemyType) : 
							FIGEnemyMiniBoss(										
										EnemyType
										)
{
	
	m_ShootCounter.SetLimit(1.5f);
	m_Accel = 1.0f;	
	m_MaxAttackCount = 6;
}





void			FIGMiniBossBomber::OnShootStyle1()
{
											
	for( int j = 0; j < 3; j++)
	{
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_TRIPPLELAYER,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180,		// degree
											j * 0.2f,
											false,
											NULL
          									);

		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(2),
											FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_TRIPPLELAYER,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180,		// degree
											j * 0.2f,
											false,
											NULL
          									);
	}

	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180,		// degree
											0.0f,
											false,
											NULL
          									);

	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(3),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180,		// degree
											0.0f,
											false,
											NULL
          									);

	


}

void		FIGMiniBossBomber::Tick_RotateBack(float dt)
{      	
	FIGEnemyMiniBoss::Tick_RotateBack(dt);
	m_MiniBossState = MINIBOSS_STATE_GOBACK;
	m_Speed = 0.0f;

	m_MiniBossState = MINIBOSS_STATE_GOBACK;
	if(m_Pos.x < 0.5f)
		m_GoBackDir = math::Facing::VectorFromAngle(180-125);
	else
		m_GoBackDir = math::Facing::VectorFromAngle(180+125);
}


